package cn.com.gof.behavior.memento;

/**
 * <p>Title: Emp</p>  
 * <p>Description: </p>  
 * @author WangJun
 * @date 2018年9月10日 下午4:30:20
 */
public class Emp {
	private String eName;
	
	private int age;
	
	private int salary;
	//备份操作
	public EmpMemento memento() {
		return new EmpMemento(this);
	}
	//数据恢复
	public void recovery(EmpMemento empMemento) {
		this.eName = empMemento.geteName();
		this.age = empMemento.getAge();
		this.salary = empMemento.getSalary();
	}
	public String geteName() {
		return eName;
	}

	public void seteName(String eName) {
		this.eName = eName;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getSalary() {
		return salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}
	
	
}
